Conventionally, a technology in which a certain given shape (template) is searched for in a target image has been widely used as template matching.
In measurement of a pattern on a semiconductor wafer using a scanning electron microscope, the template matching is performed in order to obtain a measurement position (see Patent Literature 1). Rough position alignment of a measurement position is performed by movement of a stage on which a wafer is mounted, however, in positioning accuracy of a stage, large deviation occurs on an image that is captured with high magnification by an electron microscope. In order to perform measurement in an accurate position by correcting the deviation, the template matching is performed.
However, there is a case in which an appropriate matching position is not obtained because matching is not performed appropriately due to unexpected reflection of a lower layer pattern. Therefore, a method in which matching processing is performed using only an edge of design data has been proposed (see Patent Literature 2). In this method, matching is performed by using only an edge that is obtained from design data, and correlation calculation is ignored in the other areas, so that reduction of a correlation value due to reflection of a lower layer pattern can be suppressed.